pkgname=river-bedload
pkgver=0.1.1
pkgrel=0
pkgdesc="Print river compositor info in STDOUT"
url="https://git.sr.ht/~novakane/river-bedload"
arch="x86_64 aarch64" # limited by zig aport
license="GPL-3.0-only"
maintainer="Maarten van Gompel <proycon@anaproy.nl>"
makedepends="
	wayland-dev
	wayland-protocols
	zig
	"
options="!check net"
subpackages="
	$pkgname-doc
	$pkgname-zsh-completion
"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~novakane/river-bedload/refs/download/v$pkgver/river-bedload-v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

# We may want other than "baseline" for other targets, when enabled by zig
case "$CARCH" in
	aarch64|x86_64) _cputarget=baseline ;;
esac

build() {
	# This installs it to $builddir/out
	DESTDIR="$builddir/out" zig build \
		-Doptimize=ReleaseSafe \
		--prefix /usr install \
		${_cputarget:+-Dcpu="$_cputarget"}
}

package() {
	mkdir -p "$pkgdir"
	cp -r out/* "$pkgdir"
	install -Dm644 "doc/$pkgname.1" -t "$pkgdir/usr/share/man/man1"
	install -Dm644 "completion/zsh/_river_bedload" -t "$pkgdir"/usr/share/zsh/site-functions/
}


sha512sums="
6b1fe3561005b77fd62077c855c055377453edde09754b8937c100530172af778ab18a9279e282db31e39f0ecacd26e7c2cf7981dcc34a3cfdd6a651de2d36e6  river-bedload-0.1.1.tar.gz
"
